<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://at.alicdn.com/t/font_1474698_eanzyvc2q6.css">
    <link rel="stylesheet" href="../../css/common.css">
    <title>筆記</title>
    <style>
        html,body{
            background-color: #FAF8F4;
        }
        .header .back{
           width: 1rem;
        }
        .header .right{
            width: 1rem;
        }
         .title{
            width: 100%;
            height: 1.44rem;
            padding: 0 .3rem;
            border-bottom: 1px solid #e8e8e8;
        }
         .title .top1{
            width: 100%;
            margin-bottom: .05rem;
        }
        .title .top1 span{
            font-size:.32rem;
            font-family:PingFang SC;
            font-weight:bold;
            color:rgba(51,51,51,1);
        }
        .title .top1 .iconfont{
            font-size: .28rem;
            color: #ccc;
        }
         .title  .time{
            font-size:.24rem;
            font-family:PingFang SC;
            font-weight:400;
            color:rgba(204,204,204,1);
            margin-top: .05rem;
        }
         .ct{
            width: 100%;
            padding:  .3rem;
        }
        .ct textarea{
            width: 100%;
            height: 2rem;
            font-size:.28rem;
            font-family:PingFang SC;
            font-weight:400;
            color:rgba(102,102,102,1);
            line-height:.48rem;
            min-height: .88rem;
        }
        #fit1{
            display: none;
            width: 6.74rem;
            padding: .3rem;
            border: 1px solid #e6e6e6;
            min-height: .88rem;
            resize: none;
            line-height: .24rem;
            border-radius: .03rem;
            font-size: .28rem;
            font-family: '微软雅黑', Helvetica, sans-serif;
            overflow: hidden;
            word-wrap: break-word;
            white-space: pre-wrap;
        }
    </style>
</head>
<body>
    <div id="root" class="elehide">
        <header class="header flex align-items space-between">
            <div class="back fn-ctr">
                <i class="iconfont iconfanhuianniu"></i>
            </div>
            <div class="middle fn-ctr">
                <span>筆記</span>
            </div>
            <div class="right fn-ctr">
                <span>編輯</span>
            </div>
        </header>
        <div class="main">
            <div class="title flex flex-wrap align-content-center">
                <div class="top1 flex align-item space-between">
                    <span class="flex1">彩色鉛筆的魔法教程</span>
                    <i class="iconfont iconarrow-right"></i>
                </div>
                <div class="time">2小时内</div>
            </div>
            <div class="ct">
                <pre id="fit1" class="hide">画有自己特殊的魅力，粉画笔，又称色粉笔，粉彩棒，粉笔画；采用贵金属和矿物质制成。所以色彩鲜艳丰富，色相准确，粉质细腻，不用临时调色，携带方便，可在特质的粉画纸（或者素描纸）上任意作画，能涂擦自如，也可混合，重叠，充分表现自然界色彩。</pre>
                <textarea id="fit2"></textarea>
            </div>
        </div>
    </div>
    <script src="../../js/api.js"></script>
    <script src="../../js/vue-components.js"></script>
    <script src="../../js/vue.js"></script>
    <script src="../../js/common.js"></script>
    <script>
          //高度自适应
  document.onkeydown = function () {
    var textarea = document.getElementById('fit2')
    var pre = document.getElementById('fit1');
    pre.innerHTML = textarea.value;
    var realHeight = pre.offsetHeight;//offsetHeight = height + padding + border
    if(realHeight > 120) textarea.style.height = (realHeight + 24 -32) + 'px'; //加24为一行的高度，减32为padding和border
    else textarea.style.height = realHeight - 32 + 'px';
  }



    </script>
</body>
</html>